Next | Prev | Up | Top | Contents | Index
Synchronized Schedulers: Sync-Slave Processes
Each FRS control process for a synchronized scheduler (a sync-slave) will:
- Create a synchronized Frame Scheduler using frs_create_slave(), specifying information about the master Frame Scheduler stored by the master process. The sync-master must exist. A sync-slave must specify the same time base and number of minor frames as the sync-master.
- Change the Frame Scheduler signals or exception policy, if desired (see "Setting Frame Scheduler Signals" and "Setting Exception Policies").
- Create the activity processes that will be scheduled by this synchronized Frame Scheduler, and use frs_enqueue() to enqueue them to their assigned minor frames.
- Set up signal handlers for signals from the synchronized Frame Scheduler.
- Use frs_start() to tell the synchronized Frame Scheduler that all activity processes have been enqueued.
The sync-slave notifies the master Frame Scheduler when all processes have called frs_join(). When the master Frame Scheduler starts broadcasting interrupts, scheduling will begin.
- Wait for termination or error signals.
- Use frs_destroy() to terminate the synchronized Frame Scheduler.
For an example of this kind of program structure, refer to "Examples of Multiple Synchronized Schedulers".
Tip: In this design sketch, the knowledge of which activity processes to create, and on which frames to enqueue them, is distributed throughout the code of multiple processes, where it might be hard to maintain. However, it would be possible to centralize the plan of schedulers, activities, and frames in one or more arrays that are statically initialized. This would improve the maintainability of a complex program.
Tip: A program of this type is place where you might use a barrier (see "Barriers"). For example, you want to be sure that all Frame Schedulers are successfully created before you start to create activity processes. The master and the FRS control processes could rendezvous at a barrier after creating their schedulers, but before starting to create activity processes or enqueue them.
Next | Prev | Up | Top | Contents | Index